import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: InfoCollege
 * @author: xiayuanxing
 * @description: TODO
 * @date: 2022/1/7 11:42
 * @version: 1.0
 */
public class InfoCollege implements College{

    List<Department> departmentList;

    public InfoCollege() {
       departmentList = new ArrayList<Department>();
       addDepartment("信息安全专业","信息安全专业");
       addDepartment("网络安全专业","网络安全专业");
       addDepartment("服务器安全专业","服务器安全专业");
    }

    public String getName() {
        return "信息工程学院";
    }

    public void addDepartment(String name, String desc) {
        Department department = new Department(name, desc);
        departmentList.add(department);

    }

    public Iterator createIterator() {
        return new InfoColleageIterator(departmentList);
    }
}
